AddResMenu
AddResMenu
Append names of selected resource type to menu ResType theResType ; resource Type; e.g. 'FONT' or 'DRVR' AddResMenu searches all open resource files to obtain a list of the names of resources of a specified type. The names found are sorted alphabetically
(ignoring case) and appended to the specified menu.
leads to a variable-length MenuInfo structure that is allocated on the heap.
theResType is a 4-byte resource type, such as 'FONT' or 'DRVR'. All such
resources are searched and their names are added to theMenu as
items.
Note: To exempt an application resource from this list, you may name it starting with a period (.) or percent sign (%). Alternately,
you can remove it from the list before displaying by calling
Notes: A side-effect of this call is that it enables automatic loading of resources.
Under System 7, the use of 'DRVR' as the theResType parameter is
automatically interpreted to mean that the Apple Menu is being created, so
all items in the "Apple Menu Items" folder are added to the menu instead of
all resources of type 'DRVR'.
Use this function to present the "Apple" menu as the leftmost menu in the
menu bar, as follows:
appleMenu = NewMenu( 1, "\p\024" ); /* create apple menu */ AddResMenu( appleMenu, 'DRVR' ); /* Add DA list */ InsertMenu( appleMenu, 0 ); /* install in menu bar */ You can use a similar technique to add a 'Fonts' menu. If you specify
theResType='FONT', the Menu Manager first searches all 'FOND' resources
before searching 'FONT' resources. When a duplicate is found, it is ignored.
into the menu at a selected place (rather than appending them to the end).